package com.zjuee.base.model.common.auth;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.zjuee.base.model.Description;
import lombok.*;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * User
 *
 * @author wu liang
 * @since 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_user")
public class User extends Description {

//    @NotBlank(message = "name can't be empty", groups = {Insert.class, Auth.class})
//    @Pattern(regexp = "^[a-zA-Z]\\w{2,15}$", message = "invalid name , /^[a-zA-Z]\\w{2,15}$/", groups = {Insert.class})
    @TableField(value = "user_name")
    private String name;

    //真实姓名
//    @NotBlank(message = "realName can't be empty", groups = {Insert.class, Auth.class})
    private String realName;

    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
//    @NotBlank(message = "password can't be empty", groups = {Insert.class, Auth.class})
//    @Pattern(regexp = "^[a-zA-Z]\\w{7,15}$", message = "invalid password , /^[a-zA-Z]\\w{7,15}$/", groups = {Insert.class, Update.class})
    @TableField(value = "pass_word")
    private String password;

    //手机号
//    @NotBlank(message = "phone can't be empty", groups = {Insert.class, Auth.class})
//    @Pattern(regexp = "^((13[0-9])|(15[^4,\\D])|(18[0-9])|(14[5,7])|(17[0,1,3,5-8]))\\d{8}$", groups = {Insert.class, Update.class})
    private String phone;

    //所属组织机构ID
    private Long orgId;

    //用户状态
    private Byte userStatus;

    //用户类型
    private String userType;

    //登录次数
    private Integer loginCount;

    //上次登录时间
    private Date lastLoginTime;

    //上次登录IP
    private String lastLoginIp;

    //本次登录时间
    private Date loginTime;

    //本次登录IP
    private String loginIp;

    //创建人
    private Long createId;

    //创建时间
    private Date gmtCreate;

    //修改人
    private Long modifyId;

    //修改时间
    private Date gmtModify;
}
